翻訳と辞書
Words near each other
・ Whip eel
・ Whip fan
・ Whip fan nudibranch
・ Whip fighting
・ Whip Hand
・ Whip Hubley
・ Whip inflation now
・ While Heaven Wept
・ While I Live
・ While I Run This Race
・ While I Was Gone
・ While I Was Gone (film)
・ While I'm Dancin'
・ While I'm Dead Feed the Dog
・ While London Sleeps
While loop
・ While Mexico Sleeps
・ While Mortals Sleep
・ While Mortals Sleep (album)
・ While Mortals Sleep (book)
・ While My Guitar Gently Weeps
・ While My Heart Beats
・ While My Lady Sleeps
・ While My Pretty One Sleeps
・ While New York Sleeps
・ While No One Is Watching
・ While Parents Sleep
・ While Paris Sleeps
・ While Paris Sleeps (1932 film)
・ While Passing Along This Way


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

While loop : ウィキペディア英語版
While loop

In most computer programming languages, a while loop is a control flow statement that allows code to be executed repeatedly based on a given boolean condition. The ''while'' loop can be thought of as a repeating ].
==Overview==
The ''while'' construct consists of a block of code and a condition/expression.〔http://docs.oracle.com/javase/tutorial/java/nutsandbolts/while.html〕〔https://www.tutorialcup.com/cplusplus/while-loop.htm〕 The condition/expression is evaluated, and if the condition/expression is true, the code within the block is executed. This repeats until the condition/expression becomes false. Because the ''while'' loop checks the condition/expression before the block is executed, the control structure is often also known as a pre-test loop. Compare this with the ''do while'' loop, which tests the condition/expression ''after'' the loop has executed.
For example, in the C programming language (as well as Java, C#, Objective-C, and C++, which use the same syntax in this case), the code fragment

int x = 0;
while (x < 5)

first checks whether x is less than 5, which it is, so then the is entered, where the ''printf'' function is run and x is incremented by 1. After completing all the statements in the loop body, the condition, (x < 5), is checked again, and the loop is executed again, this process repeating until the variable x has the value 5.
Note that it is possible, and in some cases desirable, for the condition to ''always'' evaluate to true, creating an infinite loop. When such a loop is created intentionally, there is usually another control structure (such as a break statement) that controls termination of the loop.
For example:

while (true)


抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「While loop」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.